//Wdg3DPlot.hpp
#pragma once
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include <boost/config.hpp>
#include <boost/function.hpp>
#include <boost/multi_array.hpp>

#include "widgetpp.hpp"

namespace wdgpp {

class Wdg3DPlot: public WdgRoot
{
public:
   typedef boost::function<void (void)> draw_fun_type; 
   
   Wdg3DPlot();
   void init(int ip, int nxp, int nyp);
   
   void cartesian_axis(
      float xlo, float xup, float xstart, float xstep, 
      float ylo, float yup, float ytart, float ystep,
      float zlo, float zup, float ztart, float zstep
   );

   void set_draw_function(draw_fun_type f);
   void set_lenght(int xlen, int ylen) const; 
   void draw() const;

   void erase() const;
   void close() const;

private:
   bool _graf;
   draw_fun_type _draw_fun;
};

typedef boost::multi_array<float, 2> matrix_type;
void surface_matrix(const matrix_type &zmat, int xp, int yp);
   
} // namespace wdgpp

